package priv.pront.code.robot.robCom_pri_2022;

import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-06-30 20:15
 */
public class RC_v5_数字宝宝 {

    static int a, b, ansa = 0, ansb = 1;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        a = scanner.nextInt();
        b = scanner.nextInt();
        String[] aa = (a + "").split("");
        String[] bb = (b + "").split("");
        for (int i = 0; i < aa.length; i++) {
            ansa += Integer.parseInt(aa[i]);
        }

        for (int i = 0; i < bb.length; i++) {
            ansb *= Integer.parseInt(bb[i]);
        }

        String max, min;
        max = Math.max(ansa, ansb) + "";
        min = Math.min(ansa, ansb) + "";
        System.out.println(max + min);
    }
}
